import request from '@/utils/request';

/*楼宇列表查询接口*/
export const fetchBuildingListApi = (params) => {
  return request({
    url: '/park/building',
    method: 'GET',
    params,
  });
};
/*楼宇删除接口*/
export const deleteBuildingApi = (id) => {
  return request({
    url: `/park/building/${id}`,
    method: 'DELETE',
  });
};

/*添加楼宇或者编辑楼宇接口*/
export const addOrEditBuildingApi = (data) => {
  if (data.id) {
    return request({
      url: `/park/building`,
      method: 'PUT',
      data,
    });
  } else {
    return request({
      url: `/park/building`,
      method: 'POST',
      data,
    });
  }
};
/*楼宇详情查询接口*/
export const fetchBuildingDetailAPI = (id) => {
  return request({
    url: `/park/building/${id}`,
    method: 'GET',
  });
};
